package com.cci.zkweb.core.entity.p8;

import java.io.Serializable;
import java.util.List;

import com.cci.zkweb.core.components.IBreadCrumbItem;
import com.cci.zkweb.core.util.ZKFUtils;

/**
 * Generic P8 Object
 * @author durzod
 */
public abstract class P8Object 
implements Serializable, Comparable<P8Object>, IBreadCrumbItem {
	private static final long serialVersionUID = 1088262669620914845L;
	
	private String id;
	private String name;
	private String author;
	private String mimeType;
	
	private String classDoc;
	private String minor;
	private String major;
	private String lastEditor;
	private String dimension;
	
	private List<ClassProperty> customClassProperties;
	private List<ClassProperty> systemClassProperties;
	
	public P8Object() { }
	
	
	public abstract String getIcon();
	public abstract boolean isFolder();

	/**
	 * BreadCrumb name
	 */
	public String getLabel() {
		return name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}
	
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public String getMimeType() {
		return mimeType;
	}
	
	public void setMimeType(String mimeType) {
		this.mimeType = mimeType;
	}
	
	public String getClassDoc() {
		return classDoc;
	}
	
	public void setClassDoc(String classDoc) {
		this.classDoc = classDoc;
	}
	
	public String getMinor() {
		return minor;
	}
	
	public void setMinor(String minor) {
		this.minor = minor;
	}
	
	public String getMajor() {
		return major;
	}
	
	public void setMajor(String major) {
		this.major = major;
	}
	
	public String getLastEditor() {
		return lastEditor;
	}
	
	public void setLastEditor(String lastEditor) {
		this.lastEditor = lastEditor;
	}
	
	public List<ClassProperty> getCustomClassProperties() {
		return customClassProperties;
	}
	
	public void setCustomClassProperties(List<ClassProperty> classProperties) {
		this.customClassProperties = classProperties;
	}
	
	public List<ClassProperty> getSystemClassProperties() {
		return systemClassProperties;
	}
	
	public void setSystemClassProperties(List<ClassProperty> classProperties) {
		this.systemClassProperties = classProperties;
	}
	
	public String getDimension() {
		return dimension;
	}
	
	public void setDimension(double dimension) {
		this.dimension = ZKFUtils.readableFileSize(dimension);
	}
	public void setDimension(String dimension) {
		this.dimension = dimension;
	}

	@Override
	public int compareTo(P8Object o) {
		return this.id.compareTo(o.getId());
	}
}
